home *** CD-ROM | disk | FTP | other *** search
/ TeX 1995 July / TeX CD-ROM July 1995 (Disc 1)(Walnut Creek)(1995).ISO / macros / plain / contrib / samples / endnote.tex < prev    next >
Encoding:
Text File  |  1989-11-22  |  1.4 KB  |  37 lines

  1. % Use \endnote{1}{text}. At the end of your document, type
  2. % \producenotes to actually flush all end notes to be printed.
  3. %
  4. % macros for making endnotes instead of footnotes
  5. % We make @ signs act like letters, temporarily, to avoid conflict
  6. % between user names and internal control sequences of plain format.
  7. \catcode`@=11
  8. \newbox\endnotebox
  9. \def\setendnotefont#1{\gdef\endnotefont{#1}}
  10. \setendnotefont{\rm}
  11. \def\endnote#1{\let\@sf\empty
  12.   \ifhmode\edef\@sf{\spacefactor\the\spacefactor}\/\fi
  13.   #1\@sf\vendnote{{#1}}}
  14. \def\vendnote#1{\global\setbox\endnotebox=
  15.    \vbox{\parindent=0pt\endnotefont\unvbox\endnotebox\bgroup
  16.    \indent\llap#1\ignorespaces\futurelet\next\aftergroup\no@te\relax}}
  17. \def\no@te{\ifcat\bgroup\noexpand\next \let\next\n@@te
  18.   \else\let\next\n@t\fi \next}
  19. \def\n@@te{\bgroup\aftergroup\@endnote\let\next}
  20. \def\n@t#1{#1\@endnote}
  21. \def\@endnote{\strut\egroup}
  22. %
  23. \newcount\enotecounter
  24. \def\resetenotecount{\global\enotecounter=0 } \resetenotecount
  25. \def\setenotecount#1{\global\enotecounter=#1 }
  26. %
  27. \def\setendnoteflagfont#1{\gdef\endnoteflagfont{#1}}
  28. \setendnoteflagfont{\sevenrm}
  29. \def\enote{\unskip
  30.   \global\advance \enotecounter by 1  % First bump the counter.
  31.   % Now convert the current value of the counter into a superscripted numeral
  32.   \endnote{{$^{\hbox{\endnoteflagfont\the\enotecounter}}$}}}
  33. %
  34. \def\producenotes{%
  35. \ifvoid\endnotebox\else\medskip\unvbox\endnotebox\par\fi}
  36. \catcode`@=12 % at signs are no longer letters
  37.